/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2012
 */

package com.tech15.pub.model;

import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.tech15.core.model.Attach;
import com.tech15.pub.model.*;
import com.tech15.pub.dao.*;
import com.tech15.pub.service.*;
import com.tech15.pub.vo.query.*;

/**
 * @author 胡作正 email:zuozhenghu@sina.com
 * @version 1.0
 * @since 1.0
 */


@Entity
@Table(name = "PUB_SOFT")
public class PubSoft extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "工具共享";
	public static final String ALIAS_ID = "序号";
	public static final String ALIAS_CATEGORY = "类别";
	public static final String ALIAS_NAME = "名称";
	public static final String ALIAS_VER = "版本";
	public static final String ALIAS_MEMO = "备注";
	
	//date formats
	

	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * 序号       db_column: ID 
     */ 	
	@Length(max=32)
	private java.lang.String id;
    /**
     * 类别       db_column: CATEGORY 
     */ 	
	@Length(max=32)
	private java.lang.String category;
    /**
     * 名称       db_column: NAME 
     */ 	
	@Length(max=150)
	private java.lang.String name;
    /**
     * 版本       db_column: VER 
     */ 	
	@Length(max=50)
	private java.lang.String ver;
    /**
     * 备注       db_column: MEMO 
     */ 	
	@Length(max=500)
	private java.lang.String memo;
	//columns END


	public PubSoft(){
	}

	public PubSoft(
		java.lang.String id
	){
		this.id = id;
	}

	

	public void setId(java.lang.String value) {
		this.id = value;
	}
	
	@Id @GeneratedValue(generator="custom-id")
	@GenericGenerator(name="custom-id", strategy = "uuid.hex")
	@Column(name = "ID", unique = true, nullable = false, insertable = true, updatable = true, length = 32)
	public java.lang.String getId() {
		return this.id;
	}
	
	@Column(name = "CATEGORY", unique = false, nullable = true, insertable = true, updatable = true, length = 32)
	public java.lang.String getCategory() {
		return this.category;
	}
	
	public void setCategory(java.lang.String value) {
		this.category = value;
	}
	
	@Column(name = "NAME", unique = false, nullable = true, insertable = true, updatable = true, length = 150)
	public java.lang.String getName() {
		return this.name;
	}
	
	public void setName(java.lang.String value) {
		this.name = value;
	}
	
	@Column(name = "VER", unique = false, nullable = true, insertable = true, updatable = true, length = 50)
	public java.lang.String getVer() {
		return this.ver;
	}
	
	public void setVer(java.lang.String value) {
		this.ver = value;
	}
	
	@Column(name = "MEMO", unique = false, nullable = true, insertable = true, updatable = true, length = 500)
	public java.lang.String getMemo() {
		return this.memo;
	}
	
	public void setMemo(java.lang.String value) {
		this.memo = value;
	}
	
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("Category",getCategory())
			.append("Name",getName())
			.append("Ver",getVer())
			.append("Memo",getMemo())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof PubSoft == false) return false;
		if(this == obj) return true;
		PubSoft other = (PubSoft)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
	
	List<Attach> attach;
	private Long userid;

	@Transient
	public Long getUserid() {
		return userid;
	}

	public void setUserid(Long userid) {
		this.userid = userid;
	}

	@Transient
	public List<Attach> getAttach() {
		return attach;
	}

	public void setAttach(List<Attach> attach) {
		this.attach = attach;
	}
}

